#include <vector>
#include <algorithm>


	template <typename T,typename Cmp>
	class ColaPrioridad {
		private: 
			std::vector<T> * v ; 
			Cmp c ; 
		public: 
			ColaPrioridad(){
				v = new std::vector<T> () ; 
			}
			void push (T s){ 
				v->push_back(s) ;
				std::push_heap(v->begin(),v->end(),c) ; 
			}

			bool empty () { 
				return v->empty() ; 
			}

			T top() { 
				return v->front() ; 
			} 
		
			void pop() { 
				std::pop_heap(v->begin(),v->end(),c) ;
				v->pop_back() ; 
			}	

			void update() { 
				std::make_heap(v->begin(),v->end(),c) ; 
			}
	} ; 

